/**
 * @Author: lt
 * @Date: 2019/8/27
 * @Last Modified by: 杨光宇
 * @Last Modified time: 2020-12-11 10:56:56
 */
import axios from '@/api/fetch';
import SERVER from '@/api/server';

// 店端 - 工时维护主查询
export const getDealerLabourHourList = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/basedata/repairProject/selectRepairItemDealer`, { params });
// 厂端 - 工时维护主查询
export const getLabourHourList = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/basedata/repairProject/selectRepairItem`, { params });

// 工时下发
export const labourDistribute = params => axios.post(`${SERVER.DMSCLOUD_REPAIR}/basedata/repairProject/downRepairItemByLabourCode`, params);
// 批量启用/停用
export const batchUpdate = (type, params) => axios.post(`${SERVER.DMSCLOUD_REPAIR}/basedata/repairProject/updateStatesRepairItemByLabourCode/${type}`, params);
// 模板导出
export const exportRepairItem = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/basedata/repairProject/exportRepairItem`, { params, responseType: 'blob' });
// 导入数据
export const importRepairItem = params => axios.post(`${SERVER.DMSCLOUD_REPAIR}/basedata/repairProject/importRepairItem`, params);
// 新增工时，编辑工时
export const saveLabour = (type, params) => axios.post(`${SERVER.DMSCLOUD_REPAIR}/basedata/repairProject/addRepairItem/${type}`, params);
// 获取工时明细
export const getLabour = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/basedata/repairProject/selectRepairItemByLabourCode`, { params });

// 获取车系
export const getAllSeries = params => axios.get('vehicleProduct/seriess/all', { params });
// 根据车系获取车型
export const getModelsBySeries = params => axios.get('vehicleProduct/models/all', { params });

// 获取车型列表
export const getSeriesModelBrandList = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/baseData/repair/getSeriesModelBrand`, { params });

// 查询所有人
export const getAllUser = params => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/basedata/users/getDealerUser`);
